﻿using Microsoft.AspNetCore.Mvc;
using Model;
using Utility;

namespace api.Plugins
{
    public static class ControllerBaseExtensions
    {
        /// <summary>
        /// 获取用户登录信息
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public static UserCache GetUserToken(this ControllerBase controller)
        {
            return RedisBase.Item_Get<UserCache>(controller.HttpContext.Request.Headers["Authorization"].ToString());
        }
    }
}
